package com.nju.crawler.executor;

import java.util.concurrent.*;

/**
 * @authorliyunfei
 * @date2022/11/11
 **/
public class CCLabThreadManager {
    private static final ExecutorService executorService =
            new ThreadPoolExecutor(7,11,2000L, TimeUnit.MILLISECONDS,new LinkedBlockingQueue<>(4));
    private static final ScheduledExecutorService scheduleExecutorService = new ScheduledThreadPoolExecutor(1);
    public static void executeService(Runnable runnable){
        executorService.execute(runnable);
    }
    public static void scheduleService(Runnable runnable,long delay,TimeUnit timeUnit){
        scheduleExecutorService.schedule(runnable, delay, timeUnit);
    }

}
